﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ExampleWebAppUsage.Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">    
    <fieldset>
    <legend>Email Factory Using</legend>
    
    <strong>Note: this is just the simple example how to use Email Factory class. Have a look on code behind for this page.</strong><br />
   <font color="red"> Please note, before sending email, setup your SMTP settings in Email.config file, and don't forget to have a look on code behind for this page :)</font> <br />
    <table>
    <tr>
    <td>
    Send to Email Address
    </td>
    <td>
    <asp:TextBox ID="tbxSendToEmail" runat="server" />
    </td>
    </tr>
    <tr>
    <td>
    Attachemtns
    </td>
    <td>
    <asp:FileUpload ID="FileUpload1" runat="server" />
    </td>
    </tr>
    <tr>
    <td colspan="2">
        <asp:Button ID="btnSendEmail" runat="server" Text="Send Email" 
            onclick="btnSendEmail_Click" />   
    </td>
    </tr>
    <tr>
    <td colspan="2">
    <asp:Label ID="lblStatus" ForeColor="Red" runat="server" />
    </td>
    </tr>
    </table>
        
    </fieldset>
    <br />
        <fieldset>
    <legend>Event Factory Using </legend>
    <strong>Note: this is just the simple example how to use Event Factory class. Have a look on code behind for this page.</strong><br />
    <font color="red"> Please note, before testing events class check settings for EmailFactory.config and if you planning to use email notification - setup your SMTP settings in Email.config file.</font>
        <table>
    <tr>
    <td>
    Event type
    </td>
    <td>
    
        <asp:RadioButtonList ID="rbxErrorTypes" runat="server">
            <asp:ListItem Text="Information" Value="Information" />
            <asp:ListItem Text="Warning" Value="Warning" />
            <asp:ListItem Text="Error" Value="Error" />
        </asp:RadioButtonList>
    
    </td>
    </tr>
    <tr>
    <td>
    Event Description
    </td>
    <td>
    <asp:TextBox ID="tbxEventDescription" runat="server" />
    </td>
    </tr>
    <tr>
    <td colspan="2">
        <asp:Button ID="btnAddEvent" runat="server" Text="Add Event" 
            onclick="btnAddEvent_Click" />
    </td>
    </tr>
    <tr>
    <td colspan="2">
       <asp:DataList ID="dtlEventsList" EnableViewState="false" DataSourceID="XmlDataSource1" runat="server">
        <ItemTemplate>
        <table style="background-color:<%#XPath("color")%>">   
        <tr>
        <td>
        <table>
        <tr>
        <td>Datetime:</td>
        <td><%#XPath("datetime")%></td>
        </tr>
        <tr>
        <td>Event Type:</td>
        <td><%#XPath("type")%></td>        
        </tr>
        <tr>
        <td>Event Url:</td>
        <td><%#XPath("url")%></td>
        </tr>
        <tr>
        <td>Event Description:</td>
        <td><%#XPath("description")%></td>
        </tr>
        <tr>
        <td>Additional info:</td>
        <td><%#XPath("additionalInfo")%></td>
        </tr>
        </table>        
         
         </td>
                  
         </tr>
         </table>
        </ItemTemplate>
        </asp:DataList>
        <asp:XmlDataSource ID="XmlDataSource1" 
            DataFile="~/App_Data/EventFactory/EventLog/EventLog.xml" runat="server" 
            XPath="/log/event"></asp:XmlDataSource>
    </td>
    </tr>
    </table>

       
    
    </fieldset>
    
    </form>
</body>
</html>
